package com.smart.manager.product.entities.body;

import com.smart.common.entities.core.BaseSearch;
import com.smart.manager.product.entities.enums.PigstyKind;
import com.smart.manager.product.entities.enums.PigstyStatus;
import com.smart.manager.product.entities.views.BasicPlaceView;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.List;


/**
 * 游戏管理  猪圈管理
 * @author leo
 * @date 2023/09/05
 */
public class RBasicPigsty {

    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel("RBasicPigsty1")
    public static class SearchBody extends BaseSearch {

        @ApiModelProperty("猪圈代码")
        private String code;

        @ApiModelProperty("所属场地")
        private String placeCode;

        @ApiModelProperty("猪圈类型")
        private PigstyKind kind;

        @ApiModelProperty("猪圈状态")
        private PigstyStatus status;

    }


    @Data
    @ApiModel("RBasicPigsty2")
    public static class EditBody  implements Serializable {

        @ApiModelProperty("猪圈代码")
        @Length(max = 30, message = "猪圈代码  不能超过30")
        @NotBlank(message = "猪圈代码  不能为空")
        private String code;

        @ApiModelProperty("猪圈名称")
        @NotBlank(message = "猪圈名称  不能为空")
        private String name;

        @ApiModelProperty("所属场地")
        @Valid
        @NotNull(message = "所属场地 不能为空")
        private BasicPlaceView place;

        @ApiModelProperty("猪圈类型")
        @NotNull(message = "猪圈类型  不能为空")
        private PigstyKind kind;

        @ApiModelProperty("猪圈容量")
        @NotNull(message = "猪圈容量  不能为空")
        private Integer number;

        @ApiModelProperty("摄像头")
        @NotNull(message = "摄像头  不能为空")
        @Size(min = 1, message = "摄像头  不能为空")
        private List<String> cameraCode;

        @ApiModelProperty("显示排序")
        @NotNull(message = "显示排序值  不能为空")
        @Min(value = 0,message = "显示排序 不能小于0")
        @Max(value = 999,message = "显示排序 不能大于999")
        private Integer sort;



        @ApiModelProperty("是否有机")
        @NotNull(message = "是否有机  不能为空")
        private Boolean isOrganic;
    }


}
